<!--
 * @Descripttion: unTitle
 * @Author: yizheng.yuan
 * @Date: 2021-12-22 14:56:59
 * @LastEditors: yizheng.yuan
 * @LastEditTime: 2021-12-22 15:49:22
-->
<template>
  <div class="home">
    <img alt="Vue logo" src="../assets/logo.png" />
    <!-- <HelloWorld msg="Welcome to Your Vue.js App"/> -->
    <!-- <aaa></aaa> -->
    <button @click="changePage">翻页</button>
    <flipPage ref="thePage" :data="data" :width="pWidth" :height="pHeight"></flipPage>
    <!-- <Page ref="thePage" :data="data" :width="pWidth" :height="pHeight"></Page> -->
  </div>
</template>

<script>
// @ is an alias to /src
import HelloWorld from "@/components/HelloWorld.vue";
import aaa from "@/components/vue-toast.vue";
import Page from "@/components/page/Page.vue";

import flipPage from "vue-flip-page";

export default {
  name: "Home",
  components: {
    flipPage,
    aaa,
    Page,
  },
  data() {
    return {
      pWidth: 400,
      pHeight: 500,
      currentIndex: 0,
      data: [
        {
          picture_image: require("../assets/one.png"),
        },
        {
          picture_image: require("../assets/two.jpg"),
        },
      ],
    };
  },
  methods: {
    changePage() {
      console.log('点击：',this.currentIndex)
      if(this.currentIndex == 0){
        this.currentIndex = 1;
      }else{
        this.currentIndex = 0;
      }
      
      // if (index === this.currentIndex) return;

      this.$refs["thePage"].toPage(this.currentIndex);
      // this.currentIndex = index;
      // this.goods_id = this.manuals[this.currentIndex].goods_id;
      // this.show = false;
    },
  },
};
</script>
